// Magic Software, Inc.
// http://www.magic-software.com
// Copyright (c) 2000, All Rights Reserved
//
// Source code from Magic Software is supplied under the terms of a license
// agreement and may not be copied or disclosed except in accordance with the
// terms of that agreement.  The various license agreements may be found at
// the Magic Software web site.  This file is subject to the license
//
// FREE SOURCE CODE
// http://www.magic-software.com/License.html/free.pdf

// David Teeder
// Copyright (C) 2010, All Rights Reserved
// www.davidteeder.co.uk
// david.teeder@gmail.com

#ifndef SIMPLESAMPLETERRAIN_H
#define SIMPLESAMPLETERRAIN_H

//#include <MgcApplication.pkg>
#include <MgcCore.pkg>
#include <MgcEngine.pkg>
#include <MgcTerrain.pkg>

class SimpleSampleTerrain
{
public:
    SimpleSampleTerrain (char* acWindowTitle, int iWidth, int iHeight,
        const MgcColor& rkBackgroundColor);

    virtual bool OnInitialize ();
    virtual void OnTerminate ();
    virtual void OnIdle ();
    virtual void OnKeyPress (unsigned char ucKey, int iX, int iY);

protected:
    void CreateTerrain ();
    void Simplify ();
//    void DrawStatistics (int iX, int iY);

    // turret-based camera motion
    virtual void MoveForward ();
    virtual void MoveBackward ();
    virtual void MoveUp ();
    virtual void MoveDown ();
    virtual void TurnLeft ();
    virtual void TurnRight ();
    virtual void LookUp ();
    virtual void LookDown ();

    // render states
    MgcWireframeStatePtr m_spkWireframeState;
    MgcZBufferStatePtr m_spkZBufferState;

    // terrain model
    MgcNodePtr m_spkScene;
    MgcTerrainPagePtr m_spkPage;

    // terrain motion
    MgcReal m_fHeightAboveTerrain;
};

#endif
